package com.lanou.moving.net;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;
import com.lanou.moving.base.BaseApplication;

/**
 * Volley的请求队列，单例模式保证一个App只有一个请求队列
 */
public class MyQueue {
    RequestQueue requestQueue;
    static MyQueue myQueue;

    private MyQueue() {
        requestQueue = Volley.newRequestQueue(BaseApplication.getAppContext());
    }

    public static MyQueue getInstance() {
        if (myQueue == null) {
            myQueue = new MyQueue();
        }
        return myQueue;
    }

    public RequestQueue getVolleyQueue() {
        return requestQueue;
    }
}
